<?php
namespace  Home\Model;
use Think\Model;
class BrotherHelpModel extends  Model
{
	protected  $_auto=array(
		array('create_time','time',self::MODEL_INSERT,'function'),
		array('name','getName',self::MODEL_BOTH,'callback'),
		array('content','getContent',self::MODEL_BOTH,'callback')	
	);
	protected  $_validate=array(
		array('name','require','请填写昵称',self::MODEL_BOTH),
		array('name','2,14','请输入2~14个字符作为您的昵称',self::MUST_VALIDATE,'length',self::MODEL_BOTH),
		array('content','7,500','请输入7~500个字符',self::MUST_VALIDATE,'length',self::MODEL_BOTH)		
	);
	
	public function getName() {
		if(empty($_REQUEST['name'])) return false;
		$name = I("name", "", "htmlspecialchars");
		return $name;
	}
	public function getContent() {
		if(empty($_REQUEST['content'])) return false;
		$content = I("content", "", "htmlspecialchars");
		return $content;
	} 
}